﻿@model NVSecurity.Models.Slide

@{
    ViewBag.Title = "Create";
    string types = ViewBag.type;
}
<script src="~/nicEditor/nicEdit.js"></script>
<script>
    bkLib.onDomLoaded(function () {
        new nicEditor({ fullPanel: true, uploadURI: '/@NVSecurity.Models.GlobalVariables.PathFolderName/Home/nicUpload' }).panelInstance('area');

    });
    bkLib.onDomLoaded(function () {
        new nicEditor({ fullPanel: true, uploadURI: '/@NVSecurity.Models.GlobalVariables.PathFolderName/Home/nicUpload' }).panelInstance('area1');

    });
    bkLib.onDomLoaded(function () {
        new nicEditor({ fullPanel: true, uploadURI: '/@NVSecurity.Models.GlobalVariables.PathFolderName/Home/nicUpload' }).panelInstance('area2');

    });
</script>
@using (Html.BeginForm("Create", "Slide", FormMethod.Post, new { id = "FormCreateNews", type = types, enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <div class="mar10 borall">
        <div class="floatl">
            <span class="floatl">
                <img src="/Areas/Admin/images/icon-48-generic.png" /></span>
            <span class="title-name">Thêm mới</span>
        </div>
        <ul class="floatr toolbar-list">
            <li id="toolbar-cancel" class="button">
                <a class="toolbar" href="/@NVSecurity.Models.GlobalVariables.PathFolderName/Slide/Index">
                    <span class="icon-32-cancel"></span>
                    Hủy bỏ
                </a>
            </li>
            <li class="button">
                <div class="toolbar">
                    <span class="icon-32-apply"></span>
                    <input type="submit" value="Lưu" />
                </div>
            </li>
        </ul>
    </div>
    <!--end borall-->
 
    <div class="clear0"></div>
    <div class="mar10 borall">
        <div class="div100">
            <div>
                <fieldset class="fromlist">
                    <ul>                                               
                        <li>
                            <label style="color: green">Hình ảnh</label>
                            <input type="file" name="img1" />
                        </li>                            
                    </ul>

                </fieldset>
            </div>
        </div>
    </div>
    
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
</script>
<script type="text/javascript">
    function CheckNull() {

        var tilte = document.getElementById('tilte').value;
        var ShortDes = document.getElementById('ShortDes').value;
        //var area = document.getElementById('area').value;


        if (tilte == "" || ShortDes == "") {
            if (tilte == "") {
                document.getElementById("TitleError").innerHTML = "Vui lòng Nhập Liệu";
                document.getElementById("tilte").focus();
            }
            //if (ShortDes == "") {
            //    document.getElementById("ShortDesError").innerHTML = "Vui lòng nhập 'Mô tả ngắn'";
            //    document.getElementById("ShortDes").focus();
            //}
            if (area == "") {
                document.getElementById("areaError").innerHTML = "Vui lòng nhập Liệu";
                document.getElementById("area").focus();
            }

            return false;


        }
        return true;


    }
</script>

<script type="text/javascript">
    $('#FormCreateNews').submit(function () {
        return CheckNull();
    });
</script>

